<!DOCTYPE html>
<html>
<body>
<canvas id='output1' width = '100' height = '100'></canvas>
<canvas id='output2' width = '100' height = '100'></canvas>
<script>
if (window.testRunner) {
    testRunner.waitUntilDone();
}

var width = 100;
var height = 100;
var aCanvas = new OffscreenCanvas(width, height);
var gl = aCanvas.getContext('webgl');
gl.clearColor(1.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
var image1 = aCanvas.transferToImageBitmap();
var image2 = aCanvas.transferToImageBitmap();

var canvas1 = document.getElementById("output1");
var ctx1 = canvas1.getContext('bitmaprenderer');
ctx1.transferFromImageBitmap(image1);

var canvas2 = document.getElementById('output2');
var ctx2 = canvas2.getContext('bitmaprenderer');
ctx2.transferFromImageBitmap(image2);

if (window.testRunner) {
    testRunner.notifyDone();
}
</script>
</body>
</html>
